Ext.define('SKJF.view.LAPORAN.REPPLANNING', {
	extend: 'Ext.grid.Panel',
	
	requires	: ['Ext.grid.*',
		'Ext.data.*',
		'Ext.form.field.Number',
		'Ext.form.field.Date',
		'Ext.tip.QuickTipManager'],
	
	itemId		: 'REPPLANNING',
	alias       : 'widget.REPPLANNING',
	//store 		: 's_repplanning',
	
	//title		: 'repplanning',
	columnLines : true,
	frame		: true,	
	margin		: 0,
	
	initComponent: function(){
		var me = this;
		
		
		
		this.store = Ext.create('SKJF.store.s_repplanning',{autoLoad:true});
		this.plugins=['bufferedrenderer'];
		this.features = [{
				ftype: 'filters',
				autoReload: true,
				encode: false,
				local: true
			},{
            ftype: 'groupingsummary'
			//startCollapsed: false
            //groupHeaderTpl: '{name}'
            //hideGroupedHeader: true,
            //enableGroupingMenu: false
        }];
		this.columns = [
			{
				header: 'TANGGAL',filterable:true,
				dataIndex: 'TANGGAL',
				renderer: Ext.util.Format.dateRenderer('d M, Y')
			},{
				header: 'KDBARANG',filterable:true,
				dataIndex: 'KDBARANG'
			},{
				header: 'NMBARANG',filterable:true,
				dataIndex: 'NMBARANG'
			},{
				header: 'CUSTOMER',filterable:true,
				dataIndex: 'CUSTOMER'
			},{
				header: 'NOTA',filterable:true,
				dataIndex: 'NOTA'
			},{
				header: 'UNIT_PRICE',filterable:true,
				dataIndex: 'UNIT_PRICE',
				align: 'right',
				renderer: function(value){
					return Ext.util.Format.currency(value, 'Rp ', 2);
				}
			},{
				header: 'KURS',filterable:true,
				dataIndex: 'KURS'
			},{
				header: 'UNIT_MASUK',filterable:true,
				dataIndex: 'UNIT_MASUK'
			},{
				header: 'UNIT_KELUAR',filterable:true,
				dataIndex: 'UNIT_KELUAR'
			},{
				header: 'SALDO_UNIT',filterable:true,
				dataIndex: 'SALDO_UNIT'
			},{
				header: 'BATCH_NO',filterable:true,
				dataIndex: 'BATCH_NO'
			},{
				header: 'ID',filterable:true,
				dataIndex: 'ID'
			}];
			
		this.dockedItems = [
			Ext.create('Ext.toolbar.Toolbar', {
				items: [{
					xtype: 'fieldcontainer',
					layout: 'hbox',
					defaultType: 'button',
					items: [{
						itemId	: 'btnprint',
						text	: 'Cetak',
						iconCls	: 'icon-print',
						action	: 'print',
						handler	: function(){
							Ext.ux.egen.Printer.mainTitle = 'Laporan Planning';
							Ext.ux.egen.Printer.printAuto = false;
							Ext.ux.egen.Printer.print(me);
							
							console.info(me);
							//Ext.ux.egen.Printer.generateBody(me);
						}
					}]
				}]
			})
		];  
		
		this.callParent(arguments);	
	}
	

});